import request from '@/utils/request'

// 查询菜单权限列表
export function listCaidan(query) {
  return request({
    url: '/sxt/caidan/list',
    method: 'get',
    params: query
  })
}

// 查询菜单列表
export function menuListCaidan() {
  return request({
    url: '/sxt/caidan/menu_list',
    method: 'get'
  })
}

// 查询菜单权限详细
export function getCaidan(menuId) {
  return request({
    url: '/sxt/caidan/' + menuId,
    method: 'get'
  })
}

// 新增菜单权限
export function addCaidan(data) {
  return request({
    url: '/sxt/caidan',
    method: 'post',
    data: data
  })
}

// 修改菜单权限
export function updateCaidan(data) {
  return request({
    url: '/sxt/caidan',
    method: 'put',
    data: data
  })
}

// 删除菜单权限
export function delCaidan(menuId) {
  return request({
    url: '/sxt/caidan/' + menuId,
    method: 'delete'
  })
}

export function roleMenuTreeselect(roleId) {
	const data = {
	  roleId
	}
  return request({
    url: '/sxt/caidan/role_caidan',
    method: 'get',
	params: data
  })
}
